package com.weicoder.shop.po

import javax.persistence.Entity
import org.hibernate.annotations.DynamicInsert
import org.hibernate.annotations.DynamicUpdate
import org.springframework.context.annotation.Scope
import org.springframework.stereotype.Component
import org.springframework.beans.factory.config.ConfigurableBeanFactory
import com.weicoder.base.annotation.Cache
import com.weicoder.base.entity.EntityUserId
import com.weicoder.site.entity.base.BaseEntityIdTime
import scala.beans.BeanProperty
import java.math.BigDecimal

/**
 * 购物车实体
 * @author WD
 * @since JDK7
 * @version 1._ 2_11-1_-24
 */
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Entity
@DynamicInsert
@DynamicUpdate
@Cache
class Trolley extends BaseEntityIdTime with EntityUserId {
  // 购买物品ID
  @BeanProperty
  var goodsId: Integer = _
  // 产品ID
  @BeanProperty
  var productId: Integer = _
  // 购买物品数量
  @BeanProperty
  var count: Integer = _
  // 用户ID
  @BeanProperty
  var userId: Integer = _
  // 价格
  @BeanProperty
  var price: BigDecimal = _
  // 总价格
  @BeanProperty
  var total: BigDecimal = _
}
